package com.dhecp.project.api.enums;

/**
 * @EnumName   亚马逊销售伙伴MarketplaceEnum
 * @Description TODO
 * @Author alula
 * @Date 2022-12-01 15:45
 */
public enum MarketplaceEnum {
    /**
     * 北美站点
     */
    NORTH("NORTH", "北美站点", "https://sellercentral.amazon.com", "https://www.amazon.com/ap/oa?","https://api.amazon.com/auth/o2/token"),
    /**
     * 欧洲站点
     */
    EUROPE("EUROPE", "欧洲站点", "https://sellercentral.amazon.co.uk", "https://eu.account.amazon.com/ap/oa?","https://api.amazon.co.uk/auth/o2/token"),
    /**
     * 亚洲站点
     */
    ASIA("ASIA", "远东站点", "https://sellercentral.amazon.co.jp", "https://apac.account.amazon.com/ap/oa?","https://api.amazon.co.jp/auth/o2/token"),
    ;

    private final String code;

    private final String cnName;

    private final String spApiAuthUrl;

    private final String cpcAuthUrl;

    private final String adsAuthUrl;

    MarketplaceEnum(String code, String cnName, String spApiAuthUrl, String cpcAuthUrl, String adsAuthUrl) {
        this.code = code;
        this.cnName = cnName;
        this.spApiAuthUrl = spApiAuthUrl;
        this.cpcAuthUrl = cpcAuthUrl;
        this.adsAuthUrl = adsAuthUrl;
    }

    public static MarketplaceEnum getEnumByCode(String code) {
        for (MarketplaceEnum marketplaceEnum : values()) {
            if (marketplaceEnum.getCode().equalsIgnoreCase(code)) {
                return marketplaceEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getCnName() {
        return cnName;
    }

    public String getSpApiAuthUrl() {
        return spApiAuthUrl;
    }

    public String getCpcAuthUrl() {
        return cpcAuthUrl;
    }
    public String getAdsAuthUrl() {
        return adsAuthUrl;
    }
}
